# encoding: utf-8
import os
from datetime import timedelta

# 配置环境变量
ENV = "development"
DEBUG = True

# csrf 配置
SECRET_KEY = os.urandom(24) if ENV == "production" else "flask_bbs"

# 数据库相关配置
SQLALCHEMY_DATABASE_URI = "mysql://root:xyx171224@127.0.0.1:3306/flask_bbs?charset=utf8"
SQLALCHEMY_TRACK_MODIFICATIONS = False

# 常量
CMS_USER_ID = "cms_user_id"

# session过期时间
PERMANENT_SESSION_LIFETIME = timedelta(days=7)

# 配置邮箱
MAIL_SERVER = "smtp.163.com"
MAIL_PORT = "25"
MAIL_USERNAME = "liuwenchao1990@163.com"
MAIL_PASSWORD = "liu180531"